﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.DB;

namespace YJKRevitColumn.ColumnModule.DataDefine
{
	public class SectionRegion
	{
		public List<CurveArrArray> GetCurvesByEdgeLoops(Autodesk.Revit.ApplicationServices.Application revitApp)
		{
			List<CurveArrArray> list = new List<CurveArrArray>();
			CurveArrArray curveArrArray = revitApp.Create.NewCurveArrArray();
			revitApp.Create.NewCurveArrArray();
			foreach (SectionLoop sectionLoop in this.m_EdgeLoops)
			{
				CurveArray edgeLoopCurves = sectionLoop.GetEdgeLoopCurves(revitApp);
				curveArrArray.Append(edgeLoopCurves);
			}
			list.Add(curveArrArray);
			return list;
		}

		public SectionRegion(List<SectionLoop> edgeLoops)
		{
			this.m_EdgeLoops = edgeLoops;
		}

		public SectionLoop.ProfileType GetRegionType()
		{
			SectionLoop.ProfileType result = SectionLoop.ProfileType.PT_IRREGULAR;
			if (this.m_EdgeLoops.Count == 1)
			{
				return this.m_EdgeLoops[0].GetRegionType();
			}
			return result;
		}

		private List<SectionLoop> m_EdgeLoops = new List<SectionLoop>();
	}
}
